        //获取应用实例
import network from '../../utils/network.js';
const app = getApp()

Page({
 
    /**
     * 页面的初始数据
     */
    data: {
      right: '../images/you1.png' ,  
      down: '../images/xia.png',
      selected:false, 
      types : 1,
      list: [],
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function () {
      var that = this;
      that.onGetHelpList("加载数据列表"); 
    },

    onGetHelpList: function (message) {
      var that = this;
      var data = {
        type: that.data.types,
      };
      network.requestLoading('http://jbc.com/system/Help/help_list  ', data, message, function (res) {
        if (res.code > 0) {
          that.setData({
            list:res.data, 
          });
        } else {
          // wx.showToast({
          //   title: res.msg,
          // });
        }
      }, function (res) {
        wx.showToast({
          title: '加载数据失败',
        })

      })
    },

    onChangeType(e){
      var that = this;
      var types = e.currentTarget.dataset.type;
      that.setData({
         types:types
      });
      that.onGetHelpList("加载数据列表"); 
    },
 
    //弹出下拉
    onnmb:function (e){
      var that = this;
      var id = e.currentTarget.dataset.id;
      var selects = e.currentTarget.dataset.selected;
      
      if (selects == true){
        that.setData({
          data_id: id,
          selected: false
        }); 
      }else{
        that.setData({
          data_id: id,
          selected : true
        }); 
      }
    }
})
